﻿<%@ Page Language="C#" MasterPageFile="~/Master.Master" Culture="th-TH" uiCulture="th" AutoEventWireup="true" CodeBehind="PS_RoyalItemRepays.aspx.cs" Inherits="KPIS.GERP.GHRMS.APP.App_UI.Forms.PS_RoyalItemRepays" %>
<%@ Register Src="~/APP_UI/UserControls/PS_RoyalItemRepays.ascx" TagName="Repays" TagPrefix="GHRMS" %>
<%@ Register Src="~/APP_UI/UserControls/PS_RoyalItemRepayDtls.ascx" TagName="RepayDtls" TagPrefix="GHRMS" %>
<%@ Register src="../Controls/user.ascx" tagname="user" tagprefix="uc1" %>
<asp:Content 
    ID="Content1" 
    runat="server" 
    contentplaceholderid="ContentPlaceHolder1">  
    
    <title>ราคาชดใช้แทนเครื่องราชอิสริยาภรณ์</title>
    <link href="../../Styles/CssClass.css" rel="stylesheet" type="text/css" />
    
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript" src="../../Scripts/DatePicker.js"></script>
            <script type="text/javascript">
                function openDetails(id) 
                {
                    radopen("PS_RoyalItemRepayDtls.aspx?RepaySeq=" + id, "DtlsWindow");
                }     
                function onTextChange(sender)
                {
                    if (sender.get_value() == "") {
                        sender.set_text("");
                    }
                }
                function isNumberKeyDotComma(event)  // ตัวเลขทศนิยม และคอมม่า
              {
                 var charCode = (event.which) ? event.which : event.keyCode
                 if(charCode > 31 && (charCode < 48 || charCode > 57) && charCode != 46 && charCode != 44){
                 //    alert("กรอกได้แต่ตัวเลขทศนิยมครับ!")
                     return false;
	              }
                 return true;
              }
                                
            </script>       
    </telerik:RadCodeBlock>
           
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" 
        Height="100%" Width="75px" Transparency="50">
        <table style="height: 100%; width: 100%" border="0">
            <tr>
                <td width="100%" align="center" valign="middle">
                    <img alt="Loading..." 
                        src="../Images/Buttons/loading.gif" 
                        style="border: 0px;" />
                </td>
            </tr>
        </table>
    </telerik:RadAjaxLoadingPanel>
    
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
        <Windows>
        <telerik:RadWindow ID="DtlsWindow" runat="server" 
            Title="รายละเอียดการปรับปรุงราคาชดใช้แทนเครื่องราชฯ" 
            Height="550px"
            Width="800px" 
            ReloadOnShow="true" 
            ShowContentDuringLoad="false"
            Modal="true" />
        </Windows>
     </telerik:RadWindowManager>
<table>
<tr>
<td>
   <!-- <uc1:user ID="user1" runat="server" /> -->
</td>
<td width="20" >
</td>


<td>
</td>
</tr>

<tr>
<td colspan = "3">
    <div class="moduleDivSlim1000x450">
    <div class="moduleDivBottom1000">

    <table align="center" width ="980px" >
    <tr>
        <td align="left" class="tableHeader">
            ราคาชดใช้แทนเครื่องราชอิสริยาภรณ์
        </td>
    </tr>
    </table>
    <table align="center" width ="980px" >
    <tr>
    <td >
    <asp:Panel ID="Panel5" 
        runat="server" 
        Width="970px" 
        Height="350px" ScrollBars="Auto">         
            <telerik:RadGrid ID="RadGrid1" 
                 runat="server" 
                 AllowAutomaticDeletes="True"
                 AllowAutomaticInserts ="false"
                 AllowAutomaticUpdates ="false" 
                 AllowFilteringByColumn="True" 
                 AllowMultiRowEdit="True" 
                 AllowMultiRowSelection="True" 
                 AllowPaging="True" 
                 AllowSorting="True" 
                 AutoGenerateColumns="False" 
                 EnableAJAX="True" 
                 EnableAJAXLoadingTemplate="True" 
                 GridLines="None" 
                 OnItemCommand="RadGrid1_ItemCommand" 
                 Skin="Outlook" Width="950px">
                 <MasterTableView 
                     AllowMultiColumnSorting="True" 
                     CellSpacing="-1" 
                     ClientDataKeyNames="Sequence" 
                     CommandItemDisplay="Top" 
                     DataKeyNames="Sequence" 
                     EditMode="EditForms" 
                     InsertItemPageIndexAction="ShowItemOnCurrentPage"                      
                     NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">                                       
                 <CommandItemTemplate>
                    <table width="100%">
                        <tr>
                            <td>
                                <asp:LinkButton ID="cmdAddNew" runat="server" 
                                    CausesValidation="False" 
                                    CommandName="InitInsert"                                                  
                                    Visible="<%# !RadGrid1.MasterTableView.IsItemInserted && RadGrid1.EditIndexes.Count <= 0 %>">
                        <img style="border:0px;vertical-align:middle;" alt="" 
                        src="../Images/Buttons/AddRecord.gif" /> เพิ่มรายการปรับปรุง</asp:LinkButton>
                                &nbsp;&nbsp;
                            </td>
                            <td align="right">
                            </td>
                        </tr>
                    </table>
                </CommandItemTemplate>
                <Columns>
                    <telerik:GridEditCommandColumn 
                        ButtonType="ImageButton" 
                        EditImageUrl = "~/App_UI/Images/Buttons/Edit.gif"
                        UniqueName="EditCommandColumn1">
                        <HeaderStyle Width="20px" />
                        <ItemStyle />
                    </telerik:GridEditCommandColumn>
                    <telerik:GridButtonColumn 
                                ButtonType="ImageButton" 
                                CommandName="Delete" 
                                ConfirmDialogType="RadWindow" 
                                ConfirmText="ลบข้อมูลที่เลือก?" 
                                Text="คลิกเพื่อลบรายการ" 
                                UniqueName="column1">
                             <ItemStyle HorizontalAlign="Center" Width="15px" />
                         </telerik:GridButtonColumn>
                         <telerik:GridBoundColumn 
                                DataField="Sequence" 
                                DataType="System.Int32" 
                                Display="False" 
                                HeaderText="Sequence" 
                                ReadOnly="True" 
                                UniqueName="Sequence" 
                                Visible="False">
                         </telerik:GridBoundColumn>
                         <telerik:GridTemplateColumn 
                            AutoPostBackOnFilter="true" 
                            ShowFilterIcon="false" 
                            CurrentFilterFunction="Contains" 
                            DataField="RefNo" 
                            FilterControlWidth="100%" 
                            HeaderStyle-HorizontalAlign="Center" 
                            HeaderStyle-Width = "150px"
                            ItemStyle-Width = "150px"
                            HeaderText="หนังสืออ้างอิงเลขที่">            
                            <ItemTemplate>              
                                <asp:LinkButton ID="targetControl" runat="server" 
                                    Text='<%# Eval("RefNo") %>' 
                                    OnClientClick='<%# string.Format("return openDetails(\"{0}\");", Eval("Sequence")) %>'>
                                </asp:LinkButton>
                            </ItemTemplate>               
                        </telerik:GridTemplateColumn> 
                         <telerik:GridBoundColumn                                 
                                DataField="Description" 
                                AutoPostBackOnFilter="true" 
                                ShowFilterIcon="false"
                                FilterControlWidth="100%"
                                HeaderText="เรื่อง"                                  
                                UniqueName="Description">
                             <HeaderStyle HorizontalAlign="Center" Width="250px" />
                         </telerik:GridBoundColumn>
                         <telerik:GridBoundColumn 
                                AutoPostBackOnFilter="true"     
                                DataField="StartDate" 
                                DataFormatString="{0:dd/MM/yyyy}" 
                                FilterControlWidth="100%" 
                                HeaderStyle-HorizontalAlign="Center" 
                                HeaderText="เริ่มมีผลตั้งแต่วันที่" 
                                ShowFilterIcon="false" 
                                UniqueName="StartDate">
                             <HeaderStyle HorizontalAlign="Center" Width="100px" />
                             <ItemStyle HorizontalAlign="Center" />
                         </telerik:GridBoundColumn>
                         <telerik:GridBoundColumn 
                                AutoPostBackOnFilter="true" 
                                DataField="EndDate" 
                                DataFormatString="{0:dd/MM/yyyy}" 
                                FilterControlWidth="100%" 
                                HeaderStyle-HorizontalAlign="Center" 
                                HeaderText="ถึงวันที่" 
                                ShowFilterIcon="false" 
                                UniqueName="EndDate">
                             <HeaderStyle HorizontalAlign="Center" Width="100px" />
                             <ItemStyle HorizontalAlign="Center" />
                         </telerik:GridBoundColumn>
                         <telerik:GridBoundColumn 
                                AutoPostBackOnFilter="true" 
                                DataField="Remarks" 
                                FilterControlWidth="100%" 
                                HeaderStyle-HorizontalAlign="Center" 
                                HeaderText="หมายเหตุ" 
                                ShowFilterIcon="false" 
                                UniqueName="Remarks">
                             <HeaderStyle HorizontalAlign="Center" Width="100px" />
                         </telerik:GridBoundColumn>
                </Columns>
                <EditFormSettings EditFormType="WebUserControl" 
                            UserControlName="../UserControls/PS_RoyalItemRepays.ascx">
                            <EditColumn UniqueName="EditCommandColumn1">
                            </EditColumn>
                        </EditFormSettings>

            </MasterTableView>
        </telerik:RadGrid>
        </asp:Panel>
        </td>
        </tr>
        </table>
</div>
</div>
</td>
</tr>
</table>
</asp:Content>
